import { lstatSync, readdirSync, realpathSync } from "fs";
import { resolve } from "path";
export const appDirectory = realpathSync(process.cwd());
export const resolveApp = (relativePath) => resolve(appDirectory, relativePath);
export const SRC_FILE = resolveApp("src");
export const getAliases = (path = SRC_FILE) => {
    const alias = {};
    const files = readdirSync(path);
    files.forEach(function (item) {
        const paths = resolve(path, item);
        const stat = lstatSync(paths);
        if (stat.isDirectory() === true) {
            alias[`@${item}`] = paths;
        }
    });
    return {
        "@": path,
        ...alias,
    };
};
